<?php
require_once("../../resources/commons.php");
require_once("../../data/Report.php");

SessionManager::getInstance()->checkSession();
header('Content-type: text/xml; charset=iso-8859-1');

$l_reportId=$_REQUEST[ZOOMAREA_ID_PARAMETER];
$l_closeFunction=$_REQUEST[ZOOMAREA_CLOSEFUNC_PARAMETER];

$l_report=Report::getFromPrimaryKey(base64_decode($l_reportId));
if(!$l_report->isAccessAllowed(SessionManager::getCurrentLoggedUserId())){
	HTTP::redirect("index.php");
}
header('Content-type: text/xml; charset=iso-8859-1');
?>
<h2>Individual report</h2>
<div style="border: 1px solid; background-color: white; padding: 5px"><?=$l_report->getNotes() ?>
</div>
<br />
<h2>Activities reports</h2>
<?php
$l_reportItems=$l_report->getItems();
foreach($l_reportItems as $l_reportItem){
	?>
	<b><?=$l_reportItem->getTitle() ?></b>
	<br/>
	<div style="border: 1px solid; background-color: white; padding: 2px"><?=$l_reportItem->getDescription() ?>
	</div>
	<?php
}
?>
<center><a href="#"
	onclick="return <?=$l_closeFunction ?>('<?=$_REQUEST[ZOOMAREA_ID_PARAMETER] ?>');"><img
	border="0" src="../../resources/images/close.png" /></a></center>
